package com.aisino.demogradle.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

import com.aisino.demogradle.mapper.StudentMapper;
import java.util.List;
import com.aisino.demogradle.entity.Student;
import com.aisino.demogradle.service.StudentService;
/**
 * @author guochuantao
 * @since 2025/9/9 16:31
 * @version 1.0
 * @description  
*/

@Service
public class StudentServiceImpl implements StudentService{

    @Resource
    private StudentMapper studentMapper;
    @Override
    public PageInfo<Student> selectPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Student> list = studentMapper.selectAll();
        return new PageInfo<>(list);
    }


    @Override
    public int deleteByPrimaryKey(Long id) {
        return studentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Student record) {
        return studentMapper.insert(record);
    }

    @Override
    public int insertSelective(Student record) {
        return studentMapper.insertSelective(record);
    }

    @Override
    public Student selectByPrimaryKey(Long id) {
        return studentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Student record) {
        return studentMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Student record) {
        return studentMapper.updateByPrimaryKey(record);
    }

    @Override
    public int batchInsert(List<Student> list) {
        return studentMapper.batchInsert(list);
    }

    @Override
    public List<Student> selectAll() {
        return studentMapper.selectAll();
    }
}
